package cn.tedu.sp09.feign;

import cn.tedu.sp01.pojo.Item;
import cn.tedu.web.util.JsonResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

@FeignClient(name = "item-service",fallback = ItemClientFB.class)   //指定feign调用的服务名称
public interface ItemClient {

    @GetMapping("/{orderId}")   //指定路径
    JsonResult<List<Item>> getItems(@PathVariable("orderId") String orderId);  //指定传递的参数

    @GetMapping("/decreaseNumber")
    JsonResult decreaseNumber(@PathVariable List<Item> items);

}
